package com.java.zhuiyun.api.backendHomepage.controller;

import com.java.zhuiyun.annotation.OptLog;
import com.java.zhuiyun.api.backendHomepage.service.BackendHomepageService;
import com.java.zhuiyun.common.response.CommonConstants;
import com.java.zhuiyun.common.response.CommonResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName BackendHomepageController
 * @Description TODO 后端首页模块
 * @Author WX
 * @Date 2023/9/18 8:28
 **/
@CrossOrigin
@RestController
@RequestMapping("/Backend_Homepage")
public class BackendHomepageController {
    @Autowired
    private BackendHomepageService backendHomepageService;

    /*
    * @Author WX
    * @Description 关卡通关排行榜
    * @Date 2023/9/18 8:37
    * @Return
    * @param null
    */
    @GetMapping("/Level_Ranking")
    @ApiOperation(value = "关卡通关排行榜")
    @OptLog(modular = "后端首页模块",type = CommonConstants.SELECT,describe = "关卡通关排行榜")
    public CommonResult selectLevelRanking ()  {
        return CommonResult.ok(backendHomepageService.selectLevelRanking());
    }

    /*
    * @Author WX
    * @Description 积分排行榜
    * @Date 2023/9/18 8:56
    * @Return
    * @param null
    */
    @GetMapping("/Score_ranking")
    @ApiOperation(value = "积分排行榜")
    @OptLog(modular = "后端首页模块",type = CommonConstants.SELECT,describe = "积分排行榜")
    public CommonResult selectScoreRanking () {
        return CommonResult.ok(backendHomepageService.selectScoreRanking());
    }
}
